/*
 * @Description: vue配置
 * @Date: 2020-03-19 15:48:25
 */
const path = require('path')
const webpack = require('webpack')
const devUrl = 'https://slytest.trscd.com.cn/' // 2.0 测试环境
module.exports = {
  devServer: {
    proxy: {
      '/wcm': {
        target: devUrl,
        changOrigin: true
      }
    },
    historyApiFallback: false
  },
  publicPath: process.env.NODE_ENV === 'production' ? '/newplanning/' : './',
  // 为了避免每次使用时都需要单独引入一遍变量样式的问题，若项目不需要可删除
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [path.resolve(__dirname, './src/assets/styles/variable.scss')]
    }
  },
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        _: 'lodash'
      })
    ]
  }
}
